LIST_FLAGS_SYSTEM = 1 << 1,
LIST_FLAGS_ENABLED = 1 << 2,
LIST_FLAGS_DISABLED = 1 << 3,
- LIST_FLAGS_NO_PREFS = 1 << 4,
- LIST_FLAGS_NO_UPDATES = 1 << 5,
+ LIST_FLAGS_ACTIVE = 1 << 4,
+ LIST_FLAGS_INACTIVE = 1 << 5,
+ LIST_FLAGS_NO_PREFS = 1 << 6,
+ LIST_FLAGS_NO_UPDATES = 1 << 7,
} ListFilterFlags;
static gboolean
while (g_variant_iter_loop (&iter, "{s@a{sv}}", &uuid, &value))
{
g_autoptr (GVariantDict) info = NULL;
- double type;
+ double type, state;
gboolean has_prefs;
gboolean has_update;
gboolean enabled;
info = g_variant_dict_new (value);
g_variant_dict_lookup (info, "type", "d", &type);
+ g_variant_dict_lookup (info, "state", "d", &state);
g_variant_dict_lookup (info, "enabled", "b", &enabled);
g_variant_dict_lookup (info, "hasPrefs", "b", &has_prefs);
g_variant_dict_lookup (info, "hasUpdate", "b", &has_update);
if (!enabled && (filter & LIST_FLAGS_DISABLED) == 0)
continue;
+ if (state == STATE_ACTIVE && (filter & LIST_FLAGS_ACTIVE) == 0)
+ continue;
+
+ if (state != STATE_ACTIVE && (filter & LIST_FLAGS_INACTIVE) == 0)
+ continue;
+
if (!has_prefs && (filter & LIST_FLAGS_NO_PREFS) == 0)
continue;
gboolean system = FALSE;
gboolean enabled = FALSE;
gboolean disabled = FALSE;
+ gboolean active = FALSE;
+ gboolean inactive = FALSE;
gboolean has_prefs = FALSE;
gboolean has_updates = FALSE;
GOptionEntry entries[] = {
{ .long_name = "disabled",
.arg = G_OPTION_ARG_NONE, .arg_data = &disabled,
.description = _("Show disabled extensions") },
+ { .long_name = "active",
+ .arg = G_OPTION_ARG_NONE, .arg_data = &active,
+ .description = _("Show extensions in active state") },
+ { .long_name = "inactive",
+ .arg = G_OPTION_ARG_NONE, .arg_data = &inactive,
+ .description = _("Show extensions in inactive state") },
{ .long_name = "prefs",
.arg = G_OPTION_ARG_NONE, .arg_data = &has_prefs,
.description = _("Show extensions with preferences") },
if (disabled || !enabled)
flags |= LIST_FLAGS_DISABLED;
+ if (active || !inactive)
+ flags |= LIST_FLAGS_ACTIVE;
+
+ if (inactive || !active)
+ flags |= LIST_FLAGS_INACTIVE;
+
if (!has_prefs)
flags |= LIST_FLAGS_NO_PREFS;